package com.derbysoft.synxisadapter.commons.repository;

import com.derbysoft.core.Limit;
import com.derbysoft.core.LimitedList;
import com.derbysoft.synxisadapter.commons.log.ReservationPair;
import com.derbysoft.synxisadapter.commons.model.Reservation;
import com.derbysoft.synxisadapter.commons.model.ReservationItem;
import com.derbysoft.synxisadapter.commons.model.ReservationLog;
import com.derbysoft.synxisadapter.commons.repository.impl.ReservationCondition;

import java.util.Date;
import java.util.List;

public interface ReservationRepository {

    Reservation findByErspCode(String ersp);

    Reservation create(String ersp, String hotelId, String passport);

    void cancel(String ersp, String confirmNumber, String cancelNumber);

    void addReservationItem(String ersp, String roomTypeCode, String ratePlaneCode, String confirmNumber);

    void updateStatus(String ersp, Reservation.Status status);

    LimitedList<Reservation> findByCondition(ReservationCondition condition, Limit limit);

    void appendLog(String erspCode, String hotelPassport, ReservationLog reservationLog, Date timestamp);

    void update(ReservationPair reservationPair);

    List<ReservationItem> loadReservationItems(Reservation reservation);
}
